<template>
  <div>
    <div>
      <checkbox :checked="isCheckAll" @change="change" />
      <span>全选</span>
    </div>
  </div>
</template>

<script>
import {mapGetters} from 'vuex'

export default {
  name: 'CarTool',
  computed: {
    ...mapGetters('car', ['isCheckAll', 'ids'])
  },
  methods: {
    change () {
      this.$store.dispatch('car/update', {
        id: this.ids,
        is_active: this.isCheckAll ? '0' : '1'
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
